#include "stdio.h"
#include "stdlib.h"
#include "string.h"

int countDistinctWord(char s[]) {
    // todo add your algorithm here
	int i,j,k;
	for (i = 0; i < strlen(s); i++)
	{
		for (j = i-1,k = i; j >= 0; j--)
		{
			if (s[i]==s[j] || s[i]==' ')
			{
				for (k = i; k < strlen(s); k++)
				{
					s[k] = s[k + 1];
				}
				i--;
			}
		}
	}
	return strlen(s);
}

int main(void) {
	char s[] = "a b c def asg da fe d c b";
	printf("%d", countDistinctWord(s));
	return 0;
}